﻿@model IEnumerable<asMeishi.web.Models.level>
@{
    ViewBag.Title = "Index";
}
<h2>
    Index</h2>
<table>
    <tr>
        <th>
            级别名
        </th>
        <th>
            级别代码
        </th>
        <th>
            权限
        </th>
        <th>
            所需经验值
        </th>
        <th>
        </th>
    </tr>
    @foreach (var item in Model)
    {
        using (Html.BeginForm())
        {
        <tr>
            <td>
                <input type="hidden" name="Id" value="@item.Id" />
                <input type="text" name="name" value="@item.name" />
            </td>
            <td>
                <input type="text" name="code" value="@item.code" />
            </td>
            <td>
                @Html.Partial("accessControl", item)
            </td>
            <td>
                <input type="text" name="fraction" value="@item.fraction" />
            </td>
            <td>
                <input type="submit" value="保存" />
                <a href="/level/del/@item.Id">删除</a>

            </td>
        </tr>
        }
    }
    @{
        asMeishi.web.Models.level itemNew = new asMeishi.web.Models.level();        
    }
    @using (Html.BeginForm())
    {
        <tr>
            <td>
                <input type="text" name="name" value="@itemNew.name" />
            </td>
            <td>
                <input type="text" name="code" value="@itemNew.code" />
            </td>
            <td>
                @Html.Partial("accessControl", itemNew)
            </td>
            <td>
                <input type="text" name="fraction" value="@itemNew.fraction" />
            </td>
            <td>
                <input type="submit" value="增加" />
            </td>
        </tr>
    }
</table>
